﻿/* ----------------------------------------------------------------------------
 * Copyright (c) Philip Stears 
 *
 * This source code is subject to terms and conditions of the Microsoft Public 
 * License (Ms-PL).
 * 
 * By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 * 
 * To request a copy of the Microsoft Public License, send a request by email
 * to license@connectbasic.net.
 *
 * This notice must not be removed from this software.
 * ---------------------------------------------------------------------------- */

namespace ConnectBasic.Execution
{
    using System;
    using Microsoft.Scripting;

    /// <summary>
    /// Represents a token.
    /// </summary>
    public struct BasicToken
    {

        /// <summary>
        /// Gets the category of the token.
        /// </summary>
        public TokenCategory Category { get; set; }

        /// <summary>
        /// Gets the kind of the token
        /// </summary>
        public BasicTokenKind Kind { get; set; }

        /// <summary>
        /// Gets the span of the token.
        /// </summary>
        public SourceSpan Span { get; set; }

        /// <summary>
        /// Gets the token's string value if it has one.
        /// </summary>
        public string ValueString { get; set; }

        /// <summary>
        /// Gets the token's floating-point value if it has one.
        /// </summary>
        public double ValueDouble { get; set; }

        /// <summary>
        /// Gets the token's integral value if it has one.
        /// </summary>
        public Int64 ValueLong { get; set; }

        /// <summary>
        /// Gets the token's boolean value if it has one.
        /// </summary>
        public bool ValueBoolean{ get; set; }
    }
}
